<template>
    <div>
      <el-upload
        class="upload-demo"
        action="/api/file/upload2/"
        :headers="header"
      >
        <el-button size="small" type="primary">点击上传</el-button>
        <template #tip>
          <div class="el-upload__tip">文件不能超过100GB</div>
        </template>
      </el-upload>
      <el-form>
        <el-form-item label="文件">
        </el-form-item>
      </el-form>
    </div>
  </template>
  
  <script lang="ts" setup>
  import { ref } from 'vue';
  import { useUserStore } from '@/stores/user';
  
  const userStore = useUserStore();
  const header = ref({
    // 这里假设用户信息中有一个 token 字段用于设置请求头
    Authorization: `Bearer ${userStore.userInfo.token as string}`
  });
  </script>
  
  <style scoped>
  
  </style>    